package deng.jboss.examples.jpawebservices;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

/**
 * 

// HSQLDB Definitions
// DBNAME: jbossdb
DROP TABLE IF EXISTS SUBJECT;
CREATE TABLE SUBJECT (
  SUBJECT_ID BIGINT GENERATED BY DEFAULT AS IDENTITY (START WITH 1),
  FIRST_NAME VARCHAR(63) NULL,
  LAST_NAME VARCHAR(63) NULL,
  DATE_OF_BIRTH DATE NULL,
  IMAGE_TYPE VARCHAR(15) NULL,
  IMAGE LONGVARBINARY NULL
);
 
 * @author dengz1
 *
 */

@Entity
@Table(name="SUBJECT")
public class Subject3 {

	@Column(name="SUBJECT_ID")
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	private Long id;
	@Column(name="FIRST_NAME")
	private String firstName;
	@Column(name="LAST_NAME")
	private String lastName;
	@Column(name="DATE_OF_BIRTH")
	private Date dateOfBirth;
	@Column(name="IMAGE")
	private byte[] image;
	@Column(name="IMAGE_TYPE")
	private String imageType;
	
	@Override
	public String toString() {
		return ToStringBuilder.reflectionToString(this, ToStringStyle.MULTI_LINE_STYLE);
	}	
		
	public void setId(Long id) {
		this.id = id;
	}
	public Long getId() {
		return id;
	}
	public String getFirstName() {
		return firstName;
	}
	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}
	public String getLastName() {
		return lastName;
	}
	public void setLastName(String lastName) {
		this.lastName = lastName;
	}
	public byte[] getImage() {
		return image;
	}
	public void setImage(byte[] image) {
		this.image = image;
	}
	public String getImageType() {
		return imageType;
	}
	public void setImageType(String imageType) {
		this.imageType = imageType;
	}
	public Date getDateOfBirth() {
		return dateOfBirth;
	}
	public void setDateOfBirth(Date dateOfBirth) {
		this.dateOfBirth = dateOfBirth;
	}
	
}
